package com.chuangjiangx.member.stored.ddd.domain.model;


/**
 * 储存明细的交易类型
 */
public enum MbrStoredType {
    RECHARGE("充值", (byte) 1),
    CONSUMER("消费", (byte) 2),
    REFUND("退款", (byte) 3),
    RECHARGE_GIFT("充值赠送",(byte) 4);

    public final String name;
    public final byte value;

    MbrStoredType(String name, byte value) {
        this.name = name;
        this.value = value;
    }

    public static MbrStoredType getStoredType(byte value) {
        for (MbrStoredType storedRulesTransactionType : MbrStoredType.values()) {
            if (storedRulesTransactionType.value == value) {
                return storedRulesTransactionType;
            }
        }
        return null;
    }
}
